//
//  ComponentProtocol.swift
//  
//
//  Created by tank on 2021/9/29.
//

import Foundation

/// 组件协议
public protocol ComponentProtocol: AnyObject {
    /// Component type
    static var type: String { get }
        
    /// Component id
    var id: String { get }
    
    /// Component type
    var type: String { get }

    var value: Any? { get set }

    var componentView: ComponentView { get }

    var page: PageProtocol? { get }

    init(id: String, value: Any?, page: PageProtocol)
}

public extension ComponentProtocol {
    var type: String {
        Self.type
    }
}
